<#-- 默认付款页面 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="${baseURL}">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>付款 - ${title}</title>
	<meta name="keywords" content="${keywords}"/>
	<meta name="description" content="${description}"/>
	<link rel="shortcut icon" type="image/x-icon" href="${baseURL}${commonPath}images/favicon.ico" media="screen" />
	<link href="${commonPath}css/common.css" type="text/css" rel="stylesheet" charset="utf-8">
	<link href="${commonPath}css/themify-icons/style.css" type="text/css" rel="stylesheet">
	<script language="javascript" src="${commonPath}js/tool.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/ajax.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/json2.js" type="text/javascript"></script>
</head>
<script type="text/javascript" language="javascript"> 
	
	
</script>
<body>
<#-- 引入页头 -->
<@include action="${newPublic_2}"/>
<div class="skeleton ">
	<div class="main wrap backgroundModule" >

		<#-- 引入服务导航 -->
		<@include action="${newPublic_4}"/>
		<form action="user/control/payment?paymentModule=${url_paymentModule}&token=${token}" method="post" >
		
		<div class="paymentModule">
	        <div class="banks">
	            <div class="head">
	                <ul>
	                    <li class="item1">&nbsp;</li>
	                    <li class="item2 on">全部支付方式</li>
	                    <li class="item3">&nbsp;</li>
	                </ul>
	            </div>
	
				<div class="bankSelect">
	            	<div class="box">
	                    <div class="title">充值：</div>
						<div style="text-align: center">
			                <table class="pay-table">
			                    <tbody>
			                            <tr>
			                                <td style="text-align: right; width: 20%">
			                                    金额:
			                                </td>
			                                <td style="text-align: left; width: 20%">
												<input type="text" id="rechargeAmount" name="rechargeAmount" class="formText" value="${rechargeAmount}" onBlur="paymentVerification();return false;"/>
			                                </td>
			                                <td style="text-align: left; width: 60%">
			                                	<span class="help">请填写要充值的金额&nbsp;</span>
			                                    <span id="error_rechargeAmount" name="errorTag" style="color: #F76560;">${error['rechargeAmount']}</span>
			                                </td>
			                            </tr>
			                    </tbody>
			                </table>
			            </div>
	            
	            	</div>
	            
	            </div>
		       
	            
	            <div class="bankSelect">
	                <#list onlinePaymentInterfaceList as onlinePaymentInterface>
	                	<div class="box">
	                        <div class="title">${onlinePaymentInterface.name}：</div>
	                        <#list onlinePaymentInterface.bankList as bank>
	                    		<label>
	                                <dl>
	                                    <dt>
	                                       <input name="paymentBank" type="radio" value="${onlinePaymentInterface.interfaceProduct}_${bank.code}"  <#if bank.selected == true> checked='checked'</#if>/>
	                                    </dt>
	                                    <dd>
	                                        <img src="${commonPath}images/bank/${bank.icon}" width="120" height="32" alt="${bank.name}"/>
	                                    </dd>
	                                </dl>
	                            </label>
	                    	</#list>
						</div>
					</#list>
	            </div>
	            <div class="payNow">
					<span class="submitButton">
						<span class="submitButton"><input type="submit" value="立即付款" /></span>
	                </span>
	                <span name="errorTag" style="color: #F76560;">${error['paymentBank']}</span>
	                <span id="error_message"  name="errorTag" style="color: #F76560;">${error['message']}</span>
	                
	            </div>
	        </div>
		</div>
		</form>
	</div>
</div>


<script language="javascript" type="text/javascript"> 
//支付校验
function paymentVerification(){
	//充值金额
	var rechargeAmount = document.getElementById('rechargeAmount');
	//支付模块
	var paymentModule = getUrlParam("paymentModule");
	
	
	var parameter = "";
	if(rechargeAmount != null){
		parameter += "&rechargeAmount="+rechargeAmount.value;
	}
	
	get_request(function(value){
		if(value != ""){
			//清除所有错误显示
			var errorTag_object = getElementsByName_pseudo("span", "errorTag");
			for(i = 0; i < errorTag_object.length; i++) {	
				if(errorTag_object[i].id != ""){
					document.getElementById(errorTag_object[i].id).innerHTML = "";
				}	
			}
			var returnValue = JSON.parse(value);//返回JSON信息.Map<String,Object>格式
			for(var key in returnValue){	
				
				var value_success = "";
				var value_error = null;
				
				for (var key in returnValue) {
					if (key == "success") {
						value_success = returnValue[key];
					} else if (key == "error") {
						value_error = returnValue[key];
					}
				}
				if (value_success == "false") { //错误
					for(var errorKey in value_error){
						document.getElementById("error_"+errorKey).innerHTML = value_error[errorKey];
					
					}
				}
			
			}
		}
	},
		"user/control/paymentVerification?paymentModule="+paymentModule+parameter+"&timestamp=" + new Date().getTime(), true);



}

</script>









<#--引入页脚-->
<@include action="${newPublic_3}"/>
</body>

</html>
